package string;

/** *   判断当前字符串是否是以给定的字符串(s)开始的
    *   boolean startsWith(String s):
    *   判断当前字符串是否是以给定的字符串(s)结束的
    *   boolean endsWith(String s):
 */
public class StartsWithDemo {
    public static void main(StringBuilderDemo[] args) {
        String str = "think in java";
        boolean starts = str.startsWith("think");//判断str是否以think开头
        System.out.println(starts);
        boolean ends = str.endsWith("g");//一个字母也行
        System.out.println(ends);
    }
}
